package com.core.reach.cloudhub.service;

import com.core.reach.cloudhub.domain.CommonResult;
import com.core.reach.cloudhub.domain.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author ga.zhang
 * @version V1.0
 * @description: TODO
 * @date 2020/3/25 16:19
 **/
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    /**
     * 获取支付信息
     *
     * @param id 编号
     * @return CommonResult
     */
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    /**
     * 超时案例
     *
     * @return String
     */
    @GetMapping("/payment/feign/timeout")
    public String paymentFeignTimeOut();

}
